The goals of this project are 1) to recruit minority and underserved patients to the IGNITE II pragmatic clinical trials (PCT) network; and 2) to test the effects of genotype-guided opioid therapy on pain control and opioid- related adverse events. Indiana University and the current investigators have previously developed research infrastructure and protocols for efficiently recruiting study participants from diverse clinical settings across Indiana. State-wide geocoded electronic health care records and community-related data allow us to identify and recruit minority study participants and those who live in federally-designated underserved areas. In coordination with our healthcare institutional partners, our multi-disciplinary team is ideally positioned to apply lessons learned from IGNITE I to implement a wide range of genomic medicine protocols, contribute to network-wide analyses, collaborate with other clinical groups, and help influence genomic clinical practice and policy. Recognizing that abuse of opioid prescriptions has become a national crisis, we propose a PCT of pharmacogenetic-guided opioid selection and dosing with a goal of optimizing pain control and increasing the safety of using opioids in clinical practice. Indiana is 9th in the nation in terms of opioid prescriptions per capita and 17th in overdose deaths. Rural and medically underserved areas found in Indiana are amongst the most affected. Despite the associated risks, however, opioids are still invaluable to managing many cases of severe pain. The most commonly prescribed opioids (oxycodone, hydrocodone, codeine, or tramadol) are converted to pharmacologically active metabolites by the liver enzyme, CYP2D6. However, nearly 10% of patients have alleles encoding either extremely low or extremely high CYP2D6 activity, warranting altered opioid dosing or selection. Despite strong evidence and clinical guidelines for using CYP2D6 genetic testing to guide opioid therapy, it is implemented in very few clinics. Leveraging our expertise in opioid pharmacogenetics, as well as the ability to identify opioid prescriptions across Indiana and perform clinical CYP2D6 genotyping, we propose the OPTIMIZE study (Opioid Pharmacogenetics-guided Therapy Implementation to MaximIZe Effectiveness), a pragmatic, prospective, randomized, clinical trial designed to test the hypothesis that implementing CYP2D6 genotyping improves opioid effectiveness and reduces associated toxicities. Using a cluster randomization study design (by clinic), study participants (n=1333) will be enrolled into one of two study arms, CYP2D6- guided opioid selection and dosing (intervention) or standard of care (control). We will recruit individuals who are either (1) scheduled for surgeries typically requiring post-operative opioids, or (2) prescribed a CYP2D6- metabolized opioid with evidence of uncontrolled chronic pain based on escalating opioid dose. Primary outcomes will be self-reported pain control and opioid-related adverse events. We expect the pharmacogenetic recommendations given to the provider will improve these outcomes, and consequently reduce the risks associated with opioid treatment.